
let iLS = 0
module.exports = {
  type: 'list',
  style: 'simple',
  searchRoute: $route('LB_liebiao'),
  actions: [
    {
      title: '选择_搜索库',
      onClick: async function () {
        const option = await $input.select({
          title: '选择',
          options: [
            {
              title: '默认搜索库serch_18av',
              value: true
            },
            {
              title: '搜索库serch_xp1',
              value: false
            }
          ]
        })
        //option//option.value
        if (option != null) {
          if (option.value) {
            $storage.put('搜索库', 'serch_18av')
          } else {
            $storage.put('搜索库', 'serch_xp1')
          }
        } else {
          $storage.put('搜索库', 'serch_18av')
        }
        $ui.toast('搜索库已设为' + $storage.get('搜索库'))
      }
    },
    {
      title: '更新日志',
      onClick: function () {
        
        $input.confirm({
          message: GXRZ,
          okBtn: '确定'
        })
        
      }
    }
  ],

  async fetch({ args, page }) {
    //let url = `https://app.movie${args.url}`
    httpbq = '//' + $prefs.get('baseURL') + '/news/ALL.html'
    let res = await http_dh.get('https:' + httpbq, header_asb)
    let ixa = res.data

    if (ixa.indexOf("value='同意(enter)'") != -1) {
      args.httpDR='https:' + httpbq 
      args.LYLY=this.route.path
      this.finish()
      $router.to(
        $route('cookie_huoqu', args)
      )
    } else {
      ixa = ixa.match(
        /<span class='altto_list'>(?:.|\n|\r)+?<\/script><\/ul><br><span class='altto'><span class="c5">/
      )
      let uutt = []
      let items = []

      let nnaa = new RegExp(/href=['"](.+?)['"]>(.+?)</g)

      let lsaa
      let wz = '//' + $prefs.get('baseURL')
      //循环获取和显示新的内容
      while ((uutt = nnaa.exec(ixa)) != null) {
        lsaa = uutt[1].indexOf(wz)
        if (lsaa == -1) {
          uutt[1] = wz + uutt[1]
        }
        uutt[1] = encodeURI('https:' + uutt[1])
        let lsls = uutt
        items.push({
          onClick: () => {
            args.iqqDR = iLS
            $router.to(
              $route('LB_liebiao', {
                title: lsls[2],
                httpDR: lsls[1],
                iqqDR: args.iqqDR
              })
            )
          },

          //大小，最多12
          spanCount: 12,
          title: uutt[2]
        })
      }
      items.shift()
      //删除数组第一个元素
      items.shift()

      items.push({
        //items.unshift({})
        title: 'xp1国产自拍',
        onClick: item => {
          args.iqqDR = iLS
          $router.to(
            $route('LB_liebiao', {
              title: item.title,
              httpDR: encodeURI('https://maa1804.com/xp1_country_self.html'),
              iqqDR: args.iqqDR
            })
          )
        }
      })
      return items
      /*
    return [
      {
        
        title: ixa
      }]
      */
    }
  }
}
